<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="android mio4kon mio">
    <meta name="keyword"  content="">
    <link rel="shortcut icon" href="/img/favicon.ico">

    <title>
        
          移动端自动化测试系列之五——AppiumLich框架使用 - Mio4kon的博客 | Mio4kon&#39;s Blog
        
    </title>

    <link rel="canonical" href="http://mio4kon.com/2017/04/13/移动端自动化测试系列之五——AppiumLich框架使用/">

    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/css/hux-blog.min.css">

    <!-- Pygments Highlight CSS -->
    <link rel="stylesheet" href="/css/highlight.css">

    <!-- Custom Fonts -->
    <!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
    <!-- Hux change font-awesome CDN to qiniu -->
    <link href="https://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">


    <!-- Hux Delete, sad but pending in China
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
    css'>
    -->


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- ga & ba script hoook -->
    <script></script>
</head>


<!-- hack iOS CSS :active style -->
<body ontouchstart="">

    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">Mio4kon</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <!-- Known Issue, found by Hux:
            <nav>'s height woule be hold on by its content.
            so, when navbar scale out, the <nav> will cover tags.
            also mask any touch event of tags, unfortunately.
        -->
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/">Home</a>
                    </li>

                    

                        
                    

                        
                        <li>
                            <a href="/about/">About</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/archives/">Archives</a>
                        </li>
                        
                    

                        
                        <li>
                            <a href="/tags/">Tags</a>
                        </li>
                        
                    
                    
                </ul>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
<script>
    // Drop Bootstarp low-performance Navbar
    // Use customize navbar with high-quality material design animation
    // in high-perf jank-free CSS3 implementation
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        // CLOSE
            $navbar.className = " ";
            // wait until animation end.
            setTimeout(function(){
                // prevent frequently toggle
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        // OPEN
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>


    <!-- Main Content -->
    
<!-- Image to hack wechat -->
<!-- <img src="http://mio4kon.com/img/icon_wechat.png" width="0" height="0"> -->
<!-- <img src="{{ site.baseurl }}/{% if page.header-img %}{{ page.header-img }}{% else %}{{ site.header-img }}{% endif %}" width="0" height="0"> -->

<!-- Post Header -->
<style type="text/css">
    header.intro-header{
        background-image: url('/img/home-bg.jpg')
    }
</style>
<header class="intro-header" >
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <div class="tags">
                        
                          <a class="tag" href="/tags/#移动自动化测试" title="移动自动化测试">移动自动化测试</a>
                        
                    </div>
                    <h1>移动端自动化测试系列之五——AppiumLich框架使用</h1>
                    <h2 class="subheading">AppiumLich框架使用</h2>
                    <span class="meta">
                        Posted by Mio4kon on
                        2017-04-13
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

    <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">

                <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>经历了前面一系列的教程,相信你一定跃跃一试了,本篇教程将告诉你如何使用框架(appium-Lich)来进行移动端的自动化测试.</p>
<p><strong>Let’s go</strong></p>
<h1 id="项目结构"><a href="#项目结构" class="headerlink" title="项目结构"></a>项目结构</h1><p>先看下项目的目录结构</p>
<p><img src="http://mio4kon.qiniudn.com/14920672562261.jpg" alt=""></p>
<ul>
<li><code>apk</code> 文件夹下放置想测试的 <code>*.apk</code> 文件</li>
<li><code>data/config.ini</code>文件中需要修改<code>[name]</code>与<code>[account]</code>中的内容</li>
<li><code>data/page.yaml</code>文件就是系列四中提到的<a href="http://mio4kon.com/2017/04/13/%E7%A7%BB%E5%8A%A8%E7%AB%AF%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E7%B3%BB%E5%88%97%E4%B9%8B%E5%9B%9B%E2%80%94%E2%80%94%E7%94%9F%E6%88%90%E5%AE%9A%E4%BD%8D%E5%85%83%E7%B4%A0/#定位元素">定位元素</a>的文件</li>
<li><code>test/conftest.py</code>文件是用于用例前的<code>setup &amp; teardown</code>操作,在<a href="http://mio4kon.com/2017/04/12/%E7%A7%BB%E5%8A%A8%E7%AB%AF%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E7%B3%BB%E5%88%97%E4%B9%8B%E4%BA%8C%E2%80%94%E2%80%94pytest%E5%85%A5%E9%97%A8%E8%AF%A6%E8%A7%A3#fixtures">系列二</a>中有说过.</li>
</ul>
<p>注: <code>[account]</code>中为测试应用的账号密码.</p>
<h1 id="配置项目"><a href="#配置项目" class="headerlink" title="配置项目"></a>配置项目</h1><h2 id="config-ini"><a href="#config-ini" class="headerlink" title="config.ini"></a>config.ini</h2><p>首先先按照上面说的,配置被测试的应用apk,以及<code>data/config.ini</code>中的内容.</p>
<p>如果不知道应用的 <code>app_package</code> (包名)和 <code>app_activity</code> (启动类名),可以通过 <code>aapt</code>工具获得.</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">进入 Android Sdk 的 build-tools 下的某一般版本</div><div class="line">cd Library/Android/sdk/build-tools/25.0.0</div><div class="line">执行 aapt dump badging &lt;apk地址&gt; | grep -E &apos;package|launchable-activity&apos;</div><div class="line">aapt dump badging /Users/mio4kon/code/python_workspace/appium-lich/apk/v2ex.apk |</div><div class="line">grep -E &apos;package|launchable-activity&apos;</div></pre></td></tr></table></figure>
<p><img src="http://mio4kon.qiniudn.com/14920684039217.jpg" alt=""></p>
<h2 id="appium-service"><a href="#appium-service" class="headerlink" title="appium service"></a>appium service</h2><p>配置完成后,需要开启 <code>appium service</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cd project_path</div><div class="line">appium --address 127.0.0.1 --port 4723 --log &quot;appium.log&quot; --log-timestamp --local-timezone --session-override</div></pre></td></tr></table></figure>
<p>此时服务开启,并在项目下生成了日志文件 <code>appium.log</code></p>
<h2 id="pages-yaml"><a href="#pages-yaml" class="headerlink" title="pages.yaml"></a>pages.yaml</h2><p>最后我们需要定位元素.</p>
<p>手机打开测试apk后,使用 <code>uiautomatorviewer</code>来查看元素信息.</p>
<p><code>uiautomatorviewer</code> 工具位于 <code>&lt;android-sdk&gt;/tools/bin</code> 目录中</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">cd Library/Android/sdk/tools/bin</div><div class="line">./uiautomatorviewer</div></pre></td></tr></table></figure>
<p>此时会打开一个GUI工具</p>
<p><img src="http://mio4kon.qiniudn.com/14920693891874-1.jpg" alt="14920693891874"></p>
<p>点击蓝色圈圈,就能看到当前手机界面上所有元素的信息了.</p>
<p>我记录了一些即将用到的一些ID信息</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">com.czbix.v2ex:id/username_tv  进入登录界面ID</div><div class="line">com.czbix.v2ex:id/account      账号输入框ID</div><div class="line">com.czbix.v2ex:id/password     密码框ID</div><div class="line">com.czbix.v2ex:id/sign_in	     登录ID</div></pre></td></tr></table></figure>
<p>在写 <code>pages.yaml</code>文件之前先开启<code>watch_dog</code></p>
<pre><code>python3 watch_dog.py
</code></pre><p>然后对应上面的信息信息完成 <code>pages.yaml</code>文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div></pre></td><td class="code"><pre><div class="line"># content of pages.yaml</div><div class="line">---</div><div class="line">HomePage:</div><div class="line">  dec: 主界面</div><div class="line">  locators:</div><div class="line">    -</div><div class="line">      name: 登录入口</div><div class="line">      type: id</div><div class="line">      value: com.czbix.v2ex:id/username_tv</div><div class="line">LoginPage:</div><div class="line">  dec: 登录页面</div><div class="line">  locators:</div><div class="line">    -</div><div class="line">      name: 账户</div><div class="line">      type: id</div><div class="line">      value: com.czbix.v2ex:id/account</div><div class="line">    -</div><div class="line">      name: 密码</div><div class="line">      type: id</div><div class="line">      value: com.czbix.v2ex:id/password</div><div class="line">    -</div><div class="line">      name: 登录</div><div class="line">      type: id</div><div class="line">      value: com.czbix.v2ex:id/sign_in</div></pre></td></tr></table></figure>
<p>保存文件后,就会发现在 <code>page/pages.py</code>中已经生成了控件元素.</p>
<p>剩下的时间就是编写用例的时候了.其实非常简单!</p>
<h1 id="编写用例"><a href="#编写用例" class="headerlink" title="编写用例"></a>编写用例</h1><p>在 <code>test/</code>目录下新建一个 <code>test_home</code> 文件</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># content of test/test_home.py</span></div><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">TestLogin</span>:</span></div><div class="line">    <span class="function"><span class="keyword">def</span> <span class="title">test_login</span><span class="params">(self, action: ElementActions)</span>:</span></div><div class="line">        L.d(<span class="string">'test_login'</span>)</div><div class="line">        account = Steps.get_account()</div><div class="line">        action.click(HomePage.登录入口)</div><div class="line">        action.text(LoginPage.账户, account[<span class="number">0</span>])</div><div class="line">        action.text(LoginPage.密码, account[<span class="number">1</span>])</div><div class="line">        action.click(LoginPage.登录)</div><div class="line">        <span class="keyword">assert</span> action.is_toast_show(<span class="string">'欢迎回来'</span>)</div></pre></td></tr></table></figure>
<p>其中<code>Steps</code>是我写的专门放steps的文件</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># content of test/steps.py</span></div><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">Steps</span>:</span></div><div class="line"><span class="meta">    @staticmethod</span></div><div class="line"><span class="meta">    @allure.step(title="获取账号和密码")</span></div><div class="line">    <span class="function"><span class="keyword">def</span> <span class="title">get_account</span><span class="params">()</span>:</span></div><div class="line">        account = Environment().get_inited_config().account_success</div><div class="line">        pwd = Environment().get_inited_config().password_success</div><div class="line">        L.d(<span class="string">'账号:%s 密码 %s'</span> % (account, pwd))</div><div class="line">        <span class="keyword">return</span> [account, pwd]</div></pre></td></tr></table></figure>
<p>登录的用例编写完了,是不是很 <strong>easy</strong>,而且在看 case 的时候也会很清晰明了.</p>
<h1 id="运行"><a href="#运行" class="headerlink" title="运行"></a>运行</h1><pre><code>python3 run.py    
</code></pre><p><img src="http://mio4kon.qiniudn.com/case-2.gif" alt="case"></p>
<p>用例就会跑起来了.跑完之后,会在 <code>report/html</code>中生成测试报告.</p>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1><p>这一系列移动自动化教程也算是结束了,最后我会附上项目的源码,欢迎大家 <code>star</code> 和提 <code>issue</code>.</p>
<p>项目地址: <a href="https://github.com/mio4kon/appium-lich" target="_blank" rel="external">https://github.com/mio4kon/appium-lich</a></p>


                <hr>

                

                <ul class="pager">
                    
                        <li class="previous">
                            <a href="/2017/06/12/Appium踩坑之旅——小米手机/" data-toggle="tooltip" data-placement="top" title="Appium踩坑之旅——小米手机">&larr; Previous Post</a>
                        </li>
                    
                    
                        <li class="next">
                            <a href="/2017/04/13/移动端自动化测试系列之四——生成定位元素/" data-toggle="tooltip" data-placement="top" title="移动端自动化测试系列之四——生成定位元素">Next Post &rarr;</a>
                        </li>
                    
                </ul>

                

                
                <!-- disqus 评论框 start -->
                <div class="comment">
                    <div id="disqus_thread" class="disqus-thread"></div>
                </div>
                <!-- disqus 评论框 end -->
                

            </div>
    <!-- Side Catalog Container -->
        
            <div class="
                col-lg-2 col-lg-offset-0
                visible-lg-block
                sidebar-container
                catalog-container">
                <div class="side-catalog">
                    <hr class="hidden-sm hidden-xs">
                    <h5>
                        <a class="catalog-toggle" href="#">CATALOG</a>
                    </h5>
                    <ul class="catalog-body"></ul>
                </div>
            </div>
        

    <!-- Sidebar Container -->

            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                <!-- Featured Tags -->
                
                <section>
                    <!-- no hr -->
                    <h5><a href="/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                       
                          <a class="tag" href="/tags/#移动自动化测试" title="移动自动化测试">移动自动化测试</a>
                        
                    </div>
                </section>
                

                <!-- Friends Blog -->
                
                <hr>
                <h5>FRIENDS</h5>
                <ul class="list-inline">

                    
                        <li><a href="http://lrd.ele.me/" target="_blank">lrd ele&#39;s Blog</a></li>
                    
                </ul>
                
            </div>

        </div>
    </div>
</article>




<!-- disqus 公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES * * */
    var disqus_shortname = "hexo-theme-huxblog";
    var disqus_identifier = "http://mio4kon.com/2017/04/13/移动端自动化测试系列之五——AppiumLich框架使用/";
    var disqus_url = "http://mio4kon.com/2017/04/13/移动端自动化测试系列之五——AppiumLich框架使用/";

    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<!-- disqus 公共JS代码 end -->




<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>
<!-- anchor-js, Doc:http://bryanbraun.github.io/anchorjs/ -->
<script>
    async("https://cdn.bootcss.com/anchor-js/1.1.1/anchor.min.js",function(){
        anchors.options = {
          visible: 'always',
          placement: 'right',
          icon: '#'
        };
        anchors.add().remove('.intro-header h1').remove('.subheading').remove('.sidebar-container h5');
    })
</script>
<style>
    /* place left on bigger screen */
    @media all and (min-width: 800px) {
        .anchorjs-link{
            position: absolute;
            left: -0.75em;
            font-size: 1.1em;
            margin-top : -0.1em;
        }
    }
</style>



    <!-- Footer -->
    <!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                
                
                

                
                    <li>
                        <a target="_blank" href="http://weibo.com/u/3198010790">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-weibo fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                
                    <li>
                        <a target="_blank"  href="https://github.com/Mio4kon">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x"></i>
                                <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                            </span>
                        </a>
                    </li>
                

                

                </ul>
                <p class="copyright text-muted">
                    Copyright &copy; Mio4kon 2019 
                    <br>
                    Theme by <a href="http://huangxuan.me">Hux</a> 
                    <span style="display: inline-block; margin: 0 5px;">
                        <i class="fa fa-heart"></i>
                    </span> 
                    Ported by <a href="http://blog.kaijun.rocks">Kaijun</a> | 
                    <iframe
                        style="margin-left: 2px; margin-bottom:-5px;"
                        frameborder="0" scrolling="0" width="91px" height="20px"
                        src="https://ghbtns.com/github-btn.html?user=kaijun&repo=hexo-theme-huxblog&type=star&count=true" >
                    </iframe>
                </p>
            </div>
        </div>
    </div>
</footer>

<!-- jQuery -->
<script src="/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="/js/hux-blog.min.js"></script>


<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>

<!-- 
     Because of the native support for backtick-style fenced code blocks 
     right within the Markdown is landed in Github Pages, 
     From V1.6, There is no need for Highlight.js, 
     so Huxblog drops it officially.

     - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0  
     - https://help.github.com/articles/creating-and-highlighting-code-blocks/    
-->
<!--
    <script>
        async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
            hljs.initHighlightingOnLoad();
        })
    </script>
    <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->


<!-- jquery.tagcloud.js -->
<script>
    // only load tagcloud.js in tag.html
    if($('#tag_cloud').length !== 0){
        async("http://mio4kon.com/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                //size: {start: 1, end: 1, unit: 'em'},
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>

<!--fastClick.js -->
<script>
    async("https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>


<!-- Google Analytics -->




<!-- Baidu Tongji -->


<!-- Side Catalog -->

<script type="text/javascript">
    function generateCatalog (selector) {
        var P = $('div.post-container'),a,n,t,l,i,c;
        a = P.find('h1,h2,h3,h4,h5,h6');
        a.each(function () {
            n = $(this).prop('tagName').toLowerCase();
            i = "#"+$(this).prop('id');
            t = $(this).text();
            c = $('<a href="'+i+'" rel="nofollow">'+t+'</a>');
            l = $('<li class="'+n+'_nav"></li>').append(c);
            $(selector).append(l);
        });
        return true;    
    }

    generateCatalog(".catalog-body");

    // toggle side catalog
    $(".catalog-toggle").click((function(e){
        e.preventDefault();
        $('.side-catalog').toggleClass("fold")
    }))

    /*
     * Doc: https://github.com/davist11/jQuery-One-Page-Nav
     * Fork by Hux to support padding
     */
    async("/js/jquery.nav.js", function () {
        $('.catalog-body').onePageNav({
            currentClass: "active",
            changeHash: !1,
            easing: "swing",
            filter: "",
            scrollSpeed: 700,
            scrollOffset: 0,
            scrollThreshold: .2,
            begin: null,
            end: null,
            scrollChange: null,
            padding: 80
        });
    });
</script>





<!-- Image to hack wechat -->
<img src="http://mio4kon.com/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->

</body>

</html>
